import {
  getRequest,
  postRequest,
  deleteRequest,
  putRequest
} from '@/libs/request'

// 会员列表
export const vipUserList = params => {
  return getRequest('/mc/admin/vip-user', params)
}

// 会员列表按时间范围搜索
export const timeRangeSearchVipList = params => {
  return getRequest('/mc/admin/vip-user', params)
}

// 某会员的下级用户列表
export const vipNextAll = id => {
  return getRequest('/mc/admin/vip-next-all' + id)
}

// 关系列表
export const relationshipList = params => {
  return getRequest(`/mc/admin/relationship?nickname`, params)
}

// 关系管理-层级管理
export const relationshipLevelList = () => {
  return getRequest('/mc/admin/get-level-by-key')
}

// 提现列表
export const withdrawDepositList = params => {
  return getRequest('/mc/admin/withdraw-deposit', params)
}

// 提现列表按时间范围搜索
export const orderSearchList = params => {
  return getRequest('/mc/admin/withdraw-deposit', params)
}

// 打款
export const withdrawRemit = (id, params) => {
  return putRequest('/mc/admin/withdraw-remit/' + id, params)
}

// 拒绝
export const withdrawRefuse = (id, params) => {
  return putRequest('/mc/admin/withdraw-refuse/' + id, params)
}

// 订单列表
export const orderList = params => {
  return getRequest('/mc/admin/order-index', params)
}

// 订单列表按时间范围搜索
export const timeRangeSearchOrderList = params => {
  return getRequest('/mc/admin/order-index', params)
}

// 订单详情
export const orderDetail = (id, params) => {
  return getRequest('/mc/admin/order-info/' + id, params)
}

// 修改配置项
export const settingConfig = params => {
  return putRequest('/mc/admin/setting-new', params)
}

// 获取设置列表
export const settingList = () => {
  return getRequest('/mc/admin/setting')
}

// 获取优质会员列表
export const bestVipList = params => {
  return getRequest('/mc/admin/quality', params)
}

// 获取优质会员的下级用户列表
export const vipNextList = id => {
  return getRequest('/mc/admin/vip-next-all?user_id=' + id)
}

// 添加优质会员
export const addBestVip = params => {
  return postRequest('/mc/admin/quality', params)
}

// 删除优质会员
export const delBestVip = id => {
  return deleteRequest('/mc/admin/quality/' + id)
}

// 优质会员详情
export const detailBestVip = id => {
  return getRequest('/mc/admin/quality?quality_id=' + id)
}

// 编辑优质会员
export const editBestVip = (id, params) => {
  return putRequest('/mc/admin/quality/' + id, params)
}

// 海报图片列表
export const baseImageList = params => {
  return getRequest('/mc/admin/base-image', params)
}

// 海报图片详情
export const baseImageDetail = id => {
  return getRequest('/mc/admin/base-image?base-image-id=' + id)
}

// 上传图片
export const imageUpload = params => {
  return postRequest('/mc/admin/upload-media', params)
}

// 上传海报图片
export const baseImageUpload = params => {
  return postRequest('/mc/admin/base-image', params)
}

// 海报图片修改
export const baseImageEdit = (id, params) => {
  return putRequest('/mc/admin/base-image/' + id, params)
}

// 删除海报图片
export const baseImageDelete = id => {
  return deleteRequest('/mc/admin/base-image/' + id)
}

// 设置默认海报图片
export const baseImageDefault = id => {
  return putRequest('/mc/admin/base-image-set-state?base_image_id=' + id)
}
